<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HttpRequestTest.aspx.cs" Inherits="HttpRequestTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script language="javascript" type="text/javascript">
        
        var req;
        var isIE;
        
        function initRequest() {
            if (window.XMLHttpRequest) {
                req = new XMLHttpRequest();
            } else if (window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
        
        function test() {
            initRequest();
            req.onreadystatechange = processRequest; // callback function
            var url = "DataFeeder.aspx";
            req.open("GET", url, true);
            req.send(null);
        }
        
        function processRequest(){
            if (req.readyState == 4) {
                if (req.status == 200) {
                    //alert(req.responseXML);
                    document.getElementById("response").appendChild(document.createTextNode(req.responseText));
                } 
            }
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">   
        
    <script>
        test();
    </script>
    <div id="response">
    </div>
    </form>
</body>
</html>
